package com.chance.cc.crawler.development.command.schedule.autohome;

import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.schedule.CrawlerJobScheduleCommand;

/**
 * @author lt
 * @version 1.0
 * @date 2020-12-10 11:35:02
 * @email okprog@sina.com
 */
public class AutoHomeCrawlerJobSchedule {
    private static CrawlerJobScheduleCommand crawlerJobScheduleCommand =
            new CrawlerJobScheduleCommand("192.168.1.215",9589);

    public static void main(String[] args) {
//        publishAutoHomeArticleCrawlerJobInfo();
//        publishAutoHomeArticleTraceCrawlerJobInfo();
//        publishAutoHomeForumReplyCrawlerJobInfo();
//        publishAutoHomeForumReleaseCrawlerJobInfo();
//        publishAutoHomeVideoCrawlerJobInfo();
//        publishAutoHomeVideoTraceCrawlerJobInfo();
//        publishAutoHomePraiseCrawlerJobInfo();
//        publishAutoHomePraiseTraceCrawlerJobInfo();
//        publishAutoHomeCheArticleCrawlerJobInfo();
//        publishAutoHomeCheArticleTraceCrawlerJobInfo();
//        publishAutoHomeCheVideoCrawlerJobInfo();
        publishAutoHomeCheVideoTraceCrawlerJobInfo();
//        publishAutoHomeForumInteractionCrawlerJobInfo();

//        deleteCrawlerJob("autohome-praise-realtime-cron");
    }

    /**
     * 汽车之家新闻调度发布
     */
    public static void publishAutoHomeArticleCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-article-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-article-realtime-cron","crawler_dev_host");
    }

    /**
     * 汽车之家新闻回溯三天回复调度发布
     */
    public static void publishAutoHomeArticleTraceCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-article-trace-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-article-trace-realtime-cron","crawler_dev_host");
    }


    /**
     * 汽车之家车家号文章实时调度发布
     */
    public static void publishAutoHomeCheArticleCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-che_article-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-che_article-realtime-cron","crawler_dev_host");
    }


    /**
     * 汽车之家车家号文章回溯三天回复调度发布
     */
    public static void publishAutoHomeCheArticleTraceCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-che_article-trace-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-che_article-trace-realtime-cron","crawler_dev_host");
    }

    /**
     * 汽车之家车家号视频实时调度发布
     */
    public static void publishAutoHomeCheVideoCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-che_video-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-che_video-realtime-cron","crawler_dev_host");
    }


    /**
     * 汽车之家车家号视频回溯三天回复调度发布
     */
    public static void publishAutoHomeCheVideoTraceCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-che_video-trace-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-che_video-trace-realtime-cron","crawler_dev_host");
    }

    /**
     * 汽车之家视频调度发布
     */
    public static void publishAutoHomeVideoCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-video-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-video-realtime-cron","crawler_dev_host");
    }

    /**
     * 汽车之家视频回溯三天回复调度发布
     */
    public static void publishAutoHomeVideoTraceCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-video-trace-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-video-trace-realtime-cron","crawler_dev_host");
    }

    /**
     * 汽车之家论坛最新回复调度发布
     */
    public static void publishAutoHomeForumReplyCrawlerJobInfo(){
//        crawlerJobScheduleCommand.republishCrawlerJob("autohome-forum_reply-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-forum_reply-realtime-cron","crawler_dev_host");
    }

    /**
     * 汽车之家论坛最新发布调度发布
     */
    public static void publishAutoHomeForumReleaseCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-forum_release-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-forum_release-realtime-cron","crawler_dev_host");

    }

    /**
     * 汽车之家论坛追溯三天互动调度发布
     */
    public static void publishAutoHomeForumInteractionCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-forum_release-interaction-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-forum_release-interaction-realtime-cron","crawler_dev_host");

    }

    /**
     * 汽车之家口碑实时调度发布
     */
    public static void publishAutoHomePraiseCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-praise-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-praise-realtime-cron","crawler_dev_host");

    }

    /**
     * 汽车之家口碑回溯三天回复调度发布
     */
    public static void publishAutoHomePraiseTraceCrawlerJobInfo(){
//        crawlerJobScheduleCommand.publishCrawlerJob("autohome-praise-trace-realtime-cron","crawler_dev_host");
        crawlerJobScheduleCommand.republishCrawlerJob("autohome-praise-trace-realtime-cron","crawler_dev_host");

    }

    /**
     * 删除调度
     * @param triggerKey
     */
    public static void deleteCrawlerJob(String triggerKey){
        HttpPage httpPage = crawlerJobScheduleCommand.deleteCrawlerJob(triggerKey, "crawler_dev_host");
        System.out.println("delete crawler job : " + httpPage.getRawText());
    }
}
